<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
	<%@include file="/WEB-INF/common/taglibs.jsp"%>    
    <title>江苏龙芯梦兰科技股份有限公司-SMT生产管理系统</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<script type="text/javascript" src="${ctx}resources/js/page.js"></script>
	<link rel="stylesheet" type="text/css" href="${ctx}resources/css/common.css" />
  </head>
 <script type="text/javascript">
  $(function(){
	 $("#cno").focus();
 });
  if(document.addEventListener){//如果是Firefox
document.addEventListener("keypress",fireFoxHandler, true);
}else{
document.attachEvent("onkeypress",ieHandler);
}

function fireFoxHandler(evt){
//alert("firefox");
if(evt.keyCode==13){
 submitFrom();
}
}

function ieHandler(evt){
//alert("IE");
if(evt.keyCode==13){
   submitFrom();
}
}
 	function submitFrom(){
 		var size = parseInt("${packageBox.maxNum}");
 		var num = parseInt("${packageBox.num}");
 		if(num<=size){
 			var cno = $("#cno").val();
 			if(cno==""){alert("请输入主板编号!");return;}
 			$("#mainForm").submit();
 		}else{
 			alert("此箱已装满!");
 		}
 	}
 </script>
<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30">
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="24" bgcolor="#353c44">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td>
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
				  <tr>
						<td width="6%" height="19" valign="bottom"><div align="center"><img src="${ctx}resources/images/tb.gif" width="14" height="14" /></div></td>
						<td width="94%" valign="bottom"><span class="STYLE1"> 包装主板信息</span></td>
				  </tr>
				</table>
            </td>
            <td>
				<div align="right" valign="bottom">
					<span class="STYLE1"> <a href="${ctx}pack/addpack.htm?orderid=${orderid}&message="  style="color: #e1e2e3;text-decoration: none">添加</a>&nbsp;&nbsp;</span>
				</div>
			</td>
          </tr>
        </table>
		</td>
      </tr>
    </table>
    </td>
  </tr>
  <tr>
		<td>
			<table width="100%" border="0" cellpadding="0" cellspacing="1">
				<form id="mainForm" action="${ctx}pack/addboard.htm" method="post">
					<input type="hidden" name="boxNo" value="${packageBox.boxNo}">
						<tr bgcolor="d3eaef">
							<td width="10%" height="20"  align="center">主板编号:<input id="cno" name="cno"/><input type="button" value="确定" onclick="submitFrom()"/></td>
						</tr>
				</form>
			</table>
		</td>
	</tr>
		  <tr>
				<td>
					<span style="font-size: 16px">${message=="Y"?"":message}</span>
				</td>
			</tr>
			<tr>
		  <tr>
				<td>
					<span style="font-size: 16px">箱号:${packageBox.boxNo},已装${packageBox.num},还可包装${packageBox.maxNum-packageBox.num}</span>
				</td>
			</tr>
			<tr>
		<td>
		</td>
	</tr>
	</tr>
		<c:if test="${packageBox.boards==null}">
		<tr><td><span style="font-size: 16px">还没有包装记录!</span></td></tr>
		</c:if>
		 <c:forEach items="${packageBox.boards}" var="board">
			  <tr>
					<td>
						<span style="font-size: 16px">${board.icNo}</span>
					</td>
				</tr>
				<tr>
		 </c:forEach>
		<td>
		</td>
	</tr>
</table>
</body>
</html>
